<template>
  <div>
    <!-- 产品名字 -->
    <div class="mini-name">
      <p>BEOKA-MINI颈椎按摩仪</p>
      <span>MINI-001</span>
    </div>
    <!-- 模式选择 -->
    <div class="mini-mode">
      <img src="../../../static/controller/1.png" alt />
      <img src="../../../static/controller/3.png" alt />
      <img src="../../../static/controller/5.png" alt />
    </div>
    <!-- 大小控制器 -->
    <div class="mini-controler">
      <view class="progress-item">
        <i-progress :percent="percent" :status="status" stroke-width="20"></i-progress>
        <img class="handle1" src="../../../static/controller/reduce.png" @click="handleReduce" />
        <img class="handle2" src="../../../static/controller/add1.png" @click="handleAdd" />
      </view>
    </div>
    <!-- 加热 和 语音 -->
    <div class="heatAndVoice">
      <div>
        <span>加热</span>
        <i-switch :value="value" @click="change"></i-switch>
      </div>
      <div>
        <span>语音</span>
        <i-switch :value="value" @click="change"></i-switch>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      percent: 0,
      status: "normal",
      value: false
    };
  },
  methods: {
    handleAdd() {
      if (this.percent > 115) return;
      this.percent = this.percent + 10;
      if (this.percent > 115) {
        this.status = "success";
      }
    },
    handleReduce() {
      console.log("1213");
      if (this.percent === 0) return;
      this.percent = this.percent - 10;
      this.status = "normal";
    }
  }
};
</script>
<style lang="scss" scoped>
.mini-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #5f5f5f;
  font-size: 30rpx;
  margin: 80rpx;
}
.mini-mode {
  display: flex;
  justify-content: space-around;
  img {
    width: 130rpx;
    height: 150rpx;
  }
}
.mini-controler {
  margin: 80rpx 60rpx;
  .progress-item {
    position: relative;
    padding-left: 110rpx;
    .handle1 {
      position: absolute;
      top: 50rpx;
      left: 50rpx;
      width: 60rpx;
      height: 60rpx;
    }
    .handle2 {
      position: absolute;
      top: 50rpx;
      right: 20rpx;
      width: 60rpx;
      height: 60rpx;
    }
  }
}
.heatAndVoice{
    display:flex;
    justify-content: center;
    margin-top: 380rpx;
    color: #979797;
    div{
        width: 50%;
        display: flex;
        justify-content: center;
        span{
            margin-right: 10rpx;
        }
    }
}
</style>
